//
//  HKFlexBoxViewController.m
//  Pods
//
//  Created by 胡锦涛 on 2021/1/19.
//

#import "HKFlexBoxViewController.h"
#import <HKLibFlexBox/YGLayout.h>
#import <HKLibFlexBox/UIView+Yoga.h>
#import <HKLibCommon/HKPrefixHeader.h>
#import <HKLibBase/HKLibBaseHeader.h>

/// 架构框架
#import <Bifrost/BifrostHeader.h>
#import <HKMediator/UIKitModuleService.h>

@interface HKFlexBoxViewController ()

@end

@implementation HKFlexBoxViewController
+ (void)load {
    [Bifrost bindURL:kRouteFlexBoxPage
           toHandler:^id _Nullable(NSDictionary * _Nullable parameters) {
        return [HKFlexBoxViewController new];
    }];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor cyanColor];
    self.title = @"FlexBox";
    UIView * bgView = [[UIView alloc] init];
    [bgView configureLayoutWithBlock:^(YGLayout * _Nonnull layout) {
      layout.isEnabled = YES;
      layout.width = YGPointValue(300);
      layout.height = YGPointValue(100);
      layout.alignSelf = YGAlignCenter;
      layout.marginTop =  YGPointValue(HK_NAVBAR_HEIGHT + 50);
      layout.marginLeft = YGPointValue(50);
      }];
    bgView.backgroundColor = UIColorGreen;
    [self.view addSubview:bgView];
    [bgView.yoga applyLayoutPreservingOrigin:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
